package com.vim.modules.web.api;

import com.vim.common.annotation.ParentModuleInfo;
import com.vim.common.model.response.RestfulResponse;
import com.vim.modules.web.model.ShopClassify;
import com.vim.modules.web.service.ShopClassifyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@ParentModuleInfo(moduleCode = "shop", moduleName = "电商平台")
@Api(value = "分类管理", description = "获取分类列表和分类详情")
@RestController
@RequestMapping(value = "/api/shop/classify/")
public class ApiShopClassifyController {

    @Resource
    private ShopClassifyService shopClassifyService;

    @ApiOperation(value = "获取分类列表", notes = "{\"code\":20000,\"msg\":\"OK\",\"data\":[{\"classifyId\":\"1\",\"classifyName\":\"手机数码\"}]}", httpMethod="GET")
    @RequestMapping(value = "/classifyList")
    public RestfulResponse classifyList(){
        return new RestfulResponse(shopClassifyService.findList(new ShopClassify()));
    }
}
